package org.jeecg.modules.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecg.common.aspect.annotation.Dict;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Data
@TableName("biz_alarm")
@ApiModel(value="告警表", description="")
public class BizAlarmEntity {
    @TableId(type = IdType.ASSIGN_ID)
    @Id
    @Column(name = "id", nullable = false)
    @ApiModelProperty(value = "表ID主键")
    private int id;
    @Basic
    @Column(name = "site_id", nullable = false, length = 32)
    @Dict(dictTable ="biz_site",dicText = "site_desc",dicCode = "site_id")
    @ApiModelProperty(value = "站点ID")
    private String siteId;
    @Basic
    @Column(name = "eq_id", nullable = false, length = 32)
    @Dict(dictTable ="biz_equipment",dicText = "eq_name",dicCode = "eq_id")
    @ApiModelProperty(value = "设备ID")
    private String eqId;
    @Basic
    @Column(name = "type", nullable = false)
    @ApiModelProperty(value = "告警类型：1.通讯告警，2.设备告警，3.其他告警")
    @Dict(dicCode = "dict_alarm_type")
    private String type;
    @Basic
    @Column(name = "level", nullable = false)
    @ApiModelProperty(value = "告警级别：1.紧急 2.严重 3.普通")
    @Dict(dicCode = "dict_alarm_level")
    private String level;
    @Basic
    @Column(name = "begin_time", nullable = false)
    @ApiModelProperty(value = "告警开始时间")
    private Timestamp beginTime;
    @Basic
    @Column(name = "end_time", nullable = true)
    @ApiModelProperty(value = "告警结束时间")
    private Timestamp endTime;
    @Basic
    @Column(name = "confirm_time", nullable = true)
    @ApiModelProperty(value = "告警确认时间")
    private Timestamp confirmTime;
    @Basic
    @Column(name = "status", nullable = false)
    @ApiModelProperty(value = "告警状态：0. 未确认告警  1.已确认告警  2.已结束告警")
    @Dict(dicCode = "dict_alarm_status")
    private String status;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getSiteId() {
        return siteId;
    }

    public void setSiteId(String siteId) {
        this.siteId = siteId;
    }

    public String getEqId() {
        return eqId;
    }

    public void setEqId(String eqId) {
        this.eqId = eqId;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getLevel() {
        return level;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    public Timestamp getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(Timestamp beginTime) {
        this.beginTime = beginTime;
    }

    public Timestamp getEndTime() {
        return endTime;
    }

    public void setEndTime(Timestamp endTime) {
        this.endTime = endTime;
    }

    public Timestamp getConfirmTime() {
        return confirmTime;
    }

    public void setConfirmTime(Timestamp confirmTime) {
        this.confirmTime = confirmTime;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        BizAlarmEntity that = (BizAlarmEntity) o;
        return id == that.id && type == that.type && level == that.level && status == that.status && Objects.equals(siteId, that.siteId) && Objects.equals(eqId, that.eqId) && Objects.equals(beginTime, that.beginTime) && Objects.equals(endTime, that.endTime) && Objects.equals(confirmTime, that.confirmTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, siteId, eqId, type, level, beginTime, endTime, confirmTime, status);
    }
}
